var WxAutoImage = require('../../js/wxAutoImageCal.js');
var app = getApp();

Page({
  data: {
    selected: true,
    selected1: false,
    imgUrls: [
      '../../image/test.jpg',
      '../../image/swiper1.jpg',
      '../../image/huaju.jpeg',      
      '../../image/zhutu.jpg'
    ],
    indicatorDots: true,
    circular: true,
    vertical: false,
    autoplay: true,
    interval: 5000,
    duration: 1000,
    indicator_color:'#25A4F8',
    iconArray: [
      {
        "iconId":'1',
        "iconUrl": '../../image/icon-qiandao.png',
        "iconText": '小曼故事'
      },
      {
        "iconId": '2',
        "iconUrl": '../../image/icon-fujin.png',
        "iconText": '找病友'
      },
      {
        "iconId": '3',
        "iconUrl": '../../image/icon-zhanhui.png',
        "iconText": '找医生'
      },
      {
        "iconId": '4',
        "iconUrl": '../../image/icon-fuli.png',
        "iconText": '健康课堂'
      },
      {
        "iconId": '5',
        "iconUrl": '../../image/icon-muma.png',
        "iconText": '我的提醒'
      },
      {
        "iconId": '6',
        "iconUrl": '../../image/icon-xingxing.png',
        "iconText": '写日记'
      },
      {
        "iconId": '7',
        "iconUrl": '../../image/icon-tiyu.png',
        "iconText": '记报告'
      },
      {
        "iconId": '8',
        "iconUrl": '../../image/icon-qinzi.png',
        "iconText": '健康分析'
      }
    ],
    itemArray: [
      {
        "itemUrl": '../../image/test.jpg',
        "itemText": '11月20日话剧《风声》'
      },
      {
        "itemUrl": '../../image/test.jpg',
        "itemText": '11月20日话剧《原野》'
      },
      {
        "itemUrl": '../../image/test.jpg',
        "itemText": '11月28日“夜店”演唱会'
      },
    ],
    forumtopic:{}
  },
  /**
 * 生命周期函数--监听页面加载
 */
  onLoad: function (options) {
    var that = this;
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {
    wx.showLoading({
      title: '正在刷新....',
    })
    setTimeout(function () {
      wx.hideLoading();
      wx.stopPullDownRefresh();
    }, 2000)
   
  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {
    wx.showLoading({
      title: '正在加载....',
    })
    setTimeout(function () {
      wx.hideLoading();
      wx.stopPullDownRefresh();
    }, 2000)
  
  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {

  },
  cusImageLoad: function (e) {
    var that = this;
    that.setData(WxAutoImage.wxAutoImageCal(e));
  },
  Click:function(e){
    switch (e.currentTarget.dataset.iconid){
      case '1': wx.showToast({
        title: 'Success',
      })
    }
  },
  selected: function (e) {
    this.setData({
      selected1: false,
      selected: true
    })
  },
  selected1: function (e) {
    this.setData({
      selected: false,
      selected1: true
    })
  },
  skip: function () {
    wx.navigateTo({
      url: 'MessageBody/MessageBody'
    })
  },
  editMsg:function(){
    wx.navigateTo({
      url: 'EditMessage/EditMessage'
    })
  }
})